<?php
include('function/connection.php'); 
$sql="SELECT * FROM tbl_products  WHERE pd_code='".$_POST['pd_code']."'";
$result=mysql_query($sql);
$row=mysql_fetch_assoc($result);
$buying_price=$row['buying_price'];
$selling_price=$row['selling_price'];
if($buying_price!=NULL)
{
	$sql="SELECT * FROM tbl_stocks_available  WHERE pd_code='".$_POST['pd_code']."'";
	$result=mysql_query($sql);
	$row=mysql_fetch_assoc($result);
	$availstock=$row['qty'];
	
	$arr = array ("bprice"=>"$buying_price","sprice"=>"$selling_price","availstock"=>"$availstock");
	echo json_encode($arr);
}
else
{
	$arr1 = array ("no"=>"no");
	echo json_encode($arr1);

}
?>